Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Consolidate type parameters into C #1076

Merged

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Mar 21, 2024

Changelog

Change: Consolidate type parameters into C

Affected types:

  • Membership types;
  • RPC request and response types;
  • Error types;

Upgrade tip:

To adapt to this change, update type parameters with the single generic C constrained by RaftTypeConfig:

// Membership types:

MembershipState<NID, N>     --> MembershipState<C>
EffectiveMembership<NID, N> --> EffectiveMembership<C>
Membership<NID, N>          --> Membership<C>

// RPC types:

VoteRequest<NID>             --> VoteRequest<C>
VoteResponse<NID>            --> VoteResponse<C>
AppendEntriesResponse<NID>   --> AppendEntriesResponse<C>
InstallSnapshotResponse<NID> --> InstallSnapshotResponse<C>
SnapshotResponse<NID>        --> SnapshotResponse<C>
SnapshotMeta<NID, N>         --> SnapshotMeta<C>

// Errors:

InitializeError<NID, N>    --> InitializeError<C>
NotInMembers<NID, N>       --> NotInMembers<C>
ClientWriteError<NID>      --> ClientWriteError<C>
CheckIsLeaderError<NID>    --> CheckIsLeaderError<C>
RaftError<NID, E>          --> RaftError<C, E>
RPCError<NID, N, E>        --> RPCError<C, E>
RemoteError<NID, N, E>     --> RemoteError<C, E>
ChangeMembershipError<NID> --> ChangeMembershipError<C>
ForwardToLeader<NID, N>    --> ForwardToLeader<C>
HigherVote<NID>            --> HigherVote<C>
InProgress<NID>            --> InProgress<C>
LearnerNotFound<NID>       --> LearnerNotFound<C>
NotAllowed<NID>            --> NotAllowed<C>
QuorumNotEnough<NID>       --> QuorumNotEnough<C>
Timeout<NID>               --> Timeout<C>
RejectVoteRequest<NID>     --> RejectVoteRequest<C>
RejectAppendEntries<NID>   --> RejectAppendEntries<C>
Fatal<NID>                 --> Fatal<C>

This change is Reviewable

@drmingdrmer drmingdrmer force-pushed the 55-effective-membership-c branch 2 times, most recently from 0efa327 to a16e335 Compare March 21, 2024 06:30
Affected types:
- Membership types;
- RPC request and response types;
- Error types;

Upgrade tip:

To adapt to this change, update type parameters with the single generic `C` constrained by `RaftTypeConfig`:

```rust,ignore

// Membership types:

MembershipState<NID, N>     --> MembershipState<C>
EffectiveMembership<NID, N> --> EffectiveMembership<C>
Membership<NID, N>          --> Membership<C>

// RPC types:

VoteRequest<NID>             --> VoteRequest<C>
VoteResponse<NID>            --> VoteResponse<C>
AppendEntriesResponse<NID>   --> AppendEntriesResponse<C>
InstallSnapshotResponse<NID> --> InstallSnapshotResponse<C>
SnapshotResponse<NID>        --> SnapshotResponse<C>
SnapshotMeta<NID, N>         --> SnapshotMeta<C>

// Errors:

InitializeError<NID, N>    --> InitializeError<C>
NotInMembers<NID, N>       --> NotInMembers<C>
ClientWriteError<NID>      --> ClientWriteError<C>
CheckIsLeaderError<NID>    --> CheckIsLeaderError<C>
RaftError<NID, E>          --> RaftError<C, E>
RPCError<NID, N, E>        --> RPCError<C, E>
RemoteError<NID, N, E>     --> RemoteError<C, E>
ChangeMembershipError<NID> --> ChangeMembershipError<C>
ForwardToLeader<NID, N>    --> ForwardToLeader<C>
HigherVote<NID>            --> HigherVote<C>
InProgress<NID>            --> InProgress<C>
LearnerNotFound<NID>       --> LearnerNotFound<C>
NotAllowed<NID>            --> NotAllowed<C>
QuorumNotEnough<NID>       --> QuorumNotEnough<C>
Timeout<NID>               --> Timeout<C>
RejectVoteRequest<NID>     --> RejectVoteRequest<C>
RejectAppendEntries<NID>   --> RejectAppendEntries<C>
Fatal<NID>                 --> Fatal<C>
```
@drmingdrmer drmingdrmer force-pushed the 55-effective-membership-c branch from a16e335 to bc0357b Compare March 21, 2024 10:30
@drmingdrmer drmingdrmer merged commit fc73dc7 into databendlabs:main Mar 21, 2024
30 of 31 checks passed
@drmingdrmer drmingdrmer deleted the 55-effective-membership-c branch March 21, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant